import { lazy } from "react"
import {
    DesktopOutlined,
    FileOutlined,
    PieChartOutlined,
} from '@ant-design/icons';


// 二级路由
export const renderChildren = [
    {
        path: "/main/fangyuan",
        element: lazy(() => import('@/component/fangyuan/Index')),
        title: '房源管理',
        icon: <DesktopOutlined />
    },
    {
        path: "/main/zhibo",
        element: lazy(() => import('@/component/zhibo/Index')),
        title: '直播管理',
        icon: <FileOutlined />
    },
    {
        path: "/main/tuangou",
        element: lazy(() => import('@/component/tuangou/Index')),
        title: '团购管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/shenhe",
        element: lazy(() => import('@/component/shenhe/Index')),
        title: '审核管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/dingdan",
        element: lazy(() => import('@/component/dingdan/Index')),
        title: '订单管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/zixun",
        element: lazy(() => import('@/component/zixun/Index')),
        title: '资讯管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/jingjiren",
        element: lazy(() => import('@/component/jingjiren/Index')),
        title: '经纪人管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/yuangong",
        element: lazy(() => import('@/component/yuangong/Index')),
        title: '员工管理',
        icon: <PieChartOutlined />
    },
    {
        path: "/main/yonghu",
        element: lazy(() => import('@/component/yonghu/Index')),
        title: '用户管理',
        icon: <PieChartOutlined />
    },
]

// 配置路由
const routes = [
    {
        path: "/main",
        element: lazy(() => import("@/page/main/Index")),
        title: "主页",
        children: renderChildren
    },
    {
        path: "/login",
        element: lazy(() => import("@/page/login/Index")),
        title: "登录页"
    },
    {
        path: "*",
        element: lazy(() => import("@/page/error/Index")),
        title: "错误页"
    },
    {
        path: "/detail/:key",
        element: lazy(() => import("@/page/detail/Index")),
        title: "详情页"
    },
    {
        path: "/live",
        element: lazy(() => import("@/component/live/Index")),
        title: "直播页"
    },
    {
        path: "/lookback",
        element: lazy(() => import("@/component/lookback/Index")),
        title: "回看页"
    },
    {
        path: "/",
        to: "/login"
    }
]

export default routes